/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package runebound.modelo.heores.experiencia;


/**
 *
 * @author malopez
 */
public class Experiencia {
    
    private int plus;
    private Atributo atributo;
    private int expConsumida;

    public Experiencia(int plus, Atributo atributo, int expConsumida) {
        this.plus = plus;
        this.atributo = atributo;
        this.expConsumida = expConsumida;
    }

    public int getExpConsumida() {
        return expConsumida;
    }
    
        
    /**
     * Amplia el valor del atributo si es el atributo de la experiencia
     * @param atributo
     * @param valor
     * @return 
     */
    public int ampliarAtributos(Atributo atributo, int valor){
        
        if (this.getAtributo()==atributo) {
            return valor + this.getPlus();
        }else{
            return valor;
        }
    }

    /**
     * @return the plus
     */
    public int getPlus() {
        return plus;
    }

    /**
     * @param plus the plus to set
     */
    public void setPlus(int plus) {
        this.plus = plus;
    }

    /**
     * @return the atributo
     */
    public Atributo getAtributo() {
        return atributo;
    }

    /**
     * @param atributo the atributo to set
     */
    public void setAtributo(Atributo atributo) {
        this.atributo = atributo;
    }

    @Override
    public String toString() {
        return "Experiencia{" + "plus=" + plus + ", atributo=" + atributo + ", expConsumida=" + expConsumida + '}';
    }
    
    
}
